﻿<!--产生权限相关的指定部门隐藏域-->
@model ElingOA6_Admin_DSJCJ.Areas.Admin.Models.DocumentClsViewModel
@GenerateHidden()
@helper GenerateHidden()
    {
        //发布指定部门
        var tmpList = Model.DocClsAuthorityList.Where(s => s.FPronoun == "ASSIGNDEPT" && s.FAuthorityType == "PUB").ToList();
        List<ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel> objList = new List<ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel>();
        List<ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel> objPropList = new List<ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel>();//级别性质列表
        if (tmpList.Count > 0)
        {
            foreach (ElingOA6_Admin_DSJCJ.Model.DocClsAuthority docClsAuthorityModel in tmpList)
            {
                objList.Add(new ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel() { Text = docClsAuthorityModel.AllName, Value = docClsAuthorityModel.FSourceNo });
                objPropList.Add(new ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel() { Text = docClsAuthorityModel.FProp, Value = docClsAuthorityModel.FSourceNo });
            }
    @Html.Hidden("hdSelPubDeptKeys", Newtonsoft.Json.JsonConvert.SerializeObject(objList));
    @Html.Hidden("hdSelPubDeptPropKeys", Newtonsoft.Json.JsonConvert.SerializeObject(objPropList));
        }
        else
        {
    @Html.Hidden("hdSelPubDeptKeys", "");
    @Html.Hidden("hdSelPubDeptPropKeys", "");
        }
        //维护指定部门
        tmpList = Model.DocClsAuthorityList.Where(s => s.FPronoun == "ASSIGNDEPT" && s.FAuthorityType == "MANAGE").ToList();
        objList = new List<ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel>();
        objPropList = new List<ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel>();//级别性质列表
        if (tmpList.Count > 0)
        {
            foreach (ElingOA6_Admin_DSJCJ.Model.DocClsAuthority docClsAuthorityModel in tmpList)
            {
                objList.Add(new ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel() { Text = docClsAuthorityModel.AllName, Value = docClsAuthorityModel.FSourceNo });
                objPropList.Add(new ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel() { Text = docClsAuthorityModel.FProp, Value = docClsAuthorityModel.FSourceNo });
            }
    @Html.Hidden("hdSelManageDeptKeys", Newtonsoft.Json.JsonConvert.SerializeObject(objList));
    @Html.Hidden("hdSelManageDeptPropKeys", Newtonsoft.Json.JsonConvert.SerializeObject(objPropList));
        }
        else
        {
    @Html.Hidden("hdSelManageDeptKeys", "");
    @Html.Hidden("hdSelManageDeptPropKeys", "");
        }
        //审核指定部门
        tmpList = Model.DocClsAuthorityList.Where(s => s.FPronoun == "ASSIGNDEPT" && s.FAuthorityType == "AUDIT").ToList();
        objList = new List<ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel>();
        objPropList = new List<ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel>();//级别性质列表
        if (tmpList.Count > 0)
        {
            foreach (ElingOA6_Admin_DSJCJ.Model.DocClsAuthority docClsAuthorityModel in tmpList)
            {
                objList.Add(new ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel() { Text = docClsAuthorityModel.AllName, Value = docClsAuthorityModel.FSourceNo });
                objPropList.Add(new ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel() { Text = docClsAuthorityModel.FProp, Value = docClsAuthorityModel.FSourceNo });
            }
    @Html.Hidden("hdSelAuditDeptKeys", Newtonsoft.Json.JsonConvert.SerializeObject(objList));
    @Html.Hidden("hdSelAuditDeptPropKeys", Newtonsoft.Json.JsonConvert.SerializeObject(objPropList));
        }
        else
        {
    @Html.Hidden("hdSelAuditDeptKeys", "");
    @Html.Hidden("hdSelAuditDeptPropKeys", "");
        }
        //查看指定部门
        tmpList = Model.DocClsAuthorityList.Where(s => s.FPronoun == "ASSIGNDEPT" && s.FAuthorityType == "LOOK").ToList();
        objList = new List<ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel>();
        objPropList = new List<ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel>();//级别性质列表
        if (tmpList.Count > 0)
        {
            foreach (ElingOA6_Admin_DSJCJ.Model.DocClsAuthority docClsAuthorityModel in tmpList)
            {
                objList.Add(new ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel() { Text = docClsAuthorityModel.AllName, Value = docClsAuthorityModel.FSourceNo });
                objPropList.Add(new ElingOA6_Admin_DSJCJ.Areas.Admin.Models.CommonValueModel() { Text = docClsAuthorityModel.FProp, Value = docClsAuthorityModel.FSourceNo });
            }
    @Html.Hidden("hdSelLookDeptKeys", Newtonsoft.Json.JsonConvert.SerializeObject(objList));
    @Html.Hidden("hdSelLookDeptPropKeys", Newtonsoft.Json.JsonConvert.SerializeObject(objPropList));
        }
        else
        {
    @Html.Hidden("hdSelLookDeptKeys", "");
    @Html.Hidden("hdSelLookDeptPropKeys", "");
        }
   
}